package helloservlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class InputServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String info = req.getParameter("info") ;	// 假设参数名称为info
		PrintWriter out = resp.getWriter() ;
		out.println("<html>") ;
		out.println("<head><title>MLDNJAVA</title></head>") ;
		out.println("<body>") ;
		out.println("<h1>" + info + "</h1>") ;
		out.println("</body>") ;
		out.println("</html>") ;
		out.close() ;
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		this.doGet(req, resp);

	}

}
